package com.wpw.web;

/**
 * @Description:
 * @ClassName: ExceptionTest
 * @CreateDate: 2019-12-17 00:30
 * @author: wupengwei
 */
public class ExceptionTest {

    public static void main(String[] args) {

        /*try {
            testException();
        } catch (Exception e) {
            e.printStackTrace();
        }*/

        try {
            //int i = 1/0;
            throw new Error();
        } catch (Error error) {
            System.out.println("error");
            error.printStackTrace();
        }
    }

    private static void testException() {
        try {
            int i = 1/0;
        } catch (Exception e) {
            throw new SerException("cuole");
        }
    }

    static class  SerException extends RuntimeException {

        String message;

        public SerException(String message) {
            super(message, null, false, false);
            this.message = message;
        }

        /*@Override
        public synchronized Throwable fillInStackTrace() {
            return this;
        }*/
    }
}